#ifndef GAMEUICONTAINER_H
#define GAMEUICONTAINER_H
//在游戏中承载每个UI界面
#include <QWidget>
#include "GameUI/album.h"
#include "GameUI/coverpage.h"
#include "GameUI/dataview.h"
#include "GameUI/record.h"
#include "GameUI/menu.h"
#include "UIEditor/mywidget.h"
#include <QMap>

class GameUIContainer:public QWidget
{
public:
    GameUIContainer(const GameUIContainer&) = delete;
    GameUIContainer& operator = (const GameUIContainer&) = delete;
    static GameUIContainer& Instance();
    ~GameUIContainer();
    void ChangeUI(QString name);
    QString curUI = "";
    void AddWidget(MyWidget* w);
private:
    void Init();
    QMap<QString,MyWidget*> myWidgets;
    Album* album;
    CoverPage* coverPage;
    DataView* dataView;
    Record* record;
    Menu* menu;
    QWidget* black = nullptr;
    GameUIContainer();
    QTimer* timer = nullptr;
    int totalTime = 1000;
    int interval = 100;
    int accumulate = 0;
    bool up = true;
    QString qss = "QWidget#gameuicontainer{border-image:url(\":/res/UI/bg.png\");}";
};

#endif // GAMEUICONTAINER_H
